SUBDIRS := test
# SUBDIRS := test_2d
# 默认目标
all: $(SUBDIRS) run 

# 运行所有测试
run: $(SUBDIRS:=.run) 

report: report.tex
	xelatex report.tex

# 为每个子目录定义构建和运行目标
$(SUBDIRS:=.run):
	@$(MAKE) -C $(patsubst %.run,%,$@) run

clean:  
	rm -f *.fdb_latexmk *.fls *.log *.aux 
	
	for dir in $(SUBDIRS); do \
		$(MAKE) -C $$dir clean; \
	done

	for dir in $(P); do \
		rm -f $$dir/*.png; \
	done


.PHONY: all clean run $(SUBDIRS:=.run)